package com.focusai.efairy.utils;


public class FileDispositionFormat {
//Content-Disposition: attachment; filename*="UTF8''app-dev-mock-test.apk"
    public static String getFileName(String disposition){
        if(disposition != null){
            int index = disposition.indexOf("''");
            if(index > 0){
                return disposition.substring(index+2,disposition.length()-1);
            }
        }
        return null;
    }

    public static String getFileExt(String disposition){
        String fileName = getFileName(disposition);
        if(fileName != null){
            int index = fileName.lastIndexOf(".");
            if(index > 0){
                return fileName.substring(index+1,fileName.length());
            }
        }
        return null;
    }
}
